//exp thresholds
//Constructs
#define FINANCE 5
#define BARRACKS 5
#define TECHLAB 5
#define WALL 5
#define WARFACT 20
//Barracks
#define FOOT 5
#define ROCKET 20
#define ELITE 40
#define ENGINEER 20
//WarFact
#define CONYARD 35
#define TANK 20
#define SHRAPNELTANK 20
#define FLAMETHROWER 50
#define RAILTANK 50
mob
	var
		credits = 3000
		controlobj = 0
		ConYards = 0
		Barracks = 0
		WarFacts = 0
		techexp = 0
		availpower = 0
		income = 0
		//tech thresholds
		//construct
		conBarracks = 0//5 techexp
		conWarFact = 0 //20 techexp
		conPowPlant = 0 //1 ConYard
		conTechLab = 0 //5 techexp
		conFinance = 0 //5 techexp
		conWall = 0 //5 techexp
		//Barracks units
		barFoot = 0 //1 Barracks, 5 techexp
		barRocket = 0 //1 Barracks, 20 techexp
		barElite = 0 //1 Barracks, 40 techexp
		barEngineer = 0 //1 Barracks, 20 techexp
		//WarFact units
		warConYard = 0 //1 WarFact, 35 techexp
		warTank = 0 //1 WarFact, 20 techexp
		warShrapnelTank = 0
		warFlamethrower = 0 //1 WarFact, 50 techexp (+1 dmg for every 5 techexp after)
		warRailTank = 0 //1 WarFact, 50 techexp (+1 dmg for every 5 techexp after)
	New()
		..()
		for(var/i = 0, 1, i++)
			if(i<20)
				calcincome()
				i -= 20
			calctech()
			if(!controlobj) break
			sleep(5)
		src << "Game over."
		for(var/mob/test in world)
			if(test != src)
				test << "[src] has been destroyed."
	proc
		calcincome()
			src.credits += src.income
		calctech()
			if(src.ConYards && !src.conPowPlant)
				src.verbs += new /turf/construct/verbcache/ConYard/verb/PowPlant()
				src.conPowPlant = 1
			if(!src.ConYards && src.conPowPlant)
				src.verbs -= /turf/construct/verbcache/ConYard/verb/PowPlant
				src.conPowPlant = 0
			if(src.ConYards && src.techexp >= FINANCE && !src.conFinance)
				src.verbs += new /turf/construct/verbcache/ConYard/verb/Finance()
				src.conFinance = 1
			if((!src.ConYards || src.techexp < FINANCE) && src.conFinance)
				src.verbs -= /turf/construct/verbcache/ConYard/verb/Finance
				src.conFinance = 0
			if(src.ConYards && src.techexp >= BARRACKS && !src.conBarracks)
				src.verbs += new /turf/construct/verbcache/ConYard/verb/Barracks()
				src.conBarracks = 1
			if((!src.ConYards || src.techexp < BARRACKS) && src.conBarracks)
				src.verbs -= /turf/construct/verbcache/ConYard/verb/Barracks
				src.conBarracks = 0
			if(src.ConYards && src.techexp >= TECHLAB && !src.conTechLab)
				src.verbs += new /turf/construct/verbcache/ConYard/verb/TechLab()
				src.conTechLab = 1
			if((!src.ConYards || src.techexp < TECHLAB) && src.conTechLab)
				src.verbs -= /turf/construct/verbcache/ConYard/verb/TechLab
				src.conTechLab = 0
			if(src.ConYards && src.techexp >= WALL && !src.conWall)
				src.verbs += new /turf/construct/verbcache/ConYard/verb/Wall()
				src.conWall = 1
			if((!src.ConYards || src.techexp < WALL) && src.conWall)
				src.verbs -= /turf/construct/verbcache/ConYard/verb/Wall
				src.conWall = 0
			if(src.ConYards && src.techexp >= WARFACT && !src.conWarFact)
				src.verbs += new /turf/construct/verbcache/ConYard/verb/WarFact()
				src.conWarFact = 1
			if((!src.ConYards || src.techexp < WARFACT) && src.conWarFact)
				src.verbs -= /turf/construct/verbcache/ConYard/verb/WarFact
				src.conWarFact = 0
			if(src.Barracks && src.techexp >= FOOT && !src.barFoot)
				src.verbs += new /turf/construct/verbcache/Barracks/verb/Foot()
				src.barFoot = 1
			if((!src.Barracks || src.techexp < FOOT) && src.barFoot)
				src.verbs -= /turf/construct/verbcache/Barracks/verb/Foot
				src.barFoot = 0
			if(src.Barracks && src.techexp >= ENGINEER && !src.barEngineer)
				src.verbs += new /turf/construct/verbcache/Barracks/verb/Engineer()
				src.barEngineer = 1
			if((!src.Barracks || src.techexp < ENGINEER) && src.barEngineer)
				src.verbs -= /turf/construct/verbcache/Barracks/verb/Engineer
				src.barEngineer = 0
			if(src.Barracks && src.techexp >= ELITE && !src.barElite)
				src.verbs += new /turf/construct/verbcache/Barracks/verb/Elite()
				src.barElite = 1
			if((!src.Barracks || src.techexp < ELITE) && src.barElite)
				src.verbs -= /turf/construct/verbcache/Barracks/verb/Elite
				src.barElite = 0
			if(src.Barracks && src.techexp >= ROCKET && !src.barRocket)
				src.verbs += new /turf/construct/verbcache/Barracks/verb/Rocket()
				src.barRocket = 1
			if((!src.Barracks || src.techexp < ROCKET) && src.barRocket)
				src.verbs -= /turf/construct/verbcache/Barracks/verb/Rocket
				src.barRocket = 0
			if(src.WarFacts && src.techexp >= CONYARD && !src.warConYard)
				src.verbs += new /turf/construct/verbcache/WarFact/verb/ConYard()
				src.warConYard = 1
			if((!src.WarFacts || src.techexp < CONYARD) && src.warTank)
				src.verbs -= /turf/construct/verbcache/WarFact/verb/ConYard
				src.warConYard = 0
			if(src.WarFacts && src.techexp >= TANK && !src.warTank)
				src.verbs += new /turf/construct/verbcache/WarFact/verb/Tank()
				src.warTank = 1
			if((!src.WarFacts || src.techexp < TANK) && src.warTank)
				src.verbs -= /turf/construct/verbcache/WarFact/verb/Tank
				src.warTank = 0
			if(src.WarFacts && src.techexp >= SHRAPNELTANK && !src.warShrapnelTank)
				src.verbs += new /turf/construct/verbcache/WarFact/verb/ShrapnelTank()
				src.warShrapnelTank = 1
			if((!src.WarFacts || src.techexp < SHRAPNELTANK) && src.warShrapnelTank)
				src.verbs -= /turf/construct/verbcache/WarFact/verb/ShrapnelTank
				src.warShrapnelTank = 0
			if(src.WarFacts && src.techexp >= FLAMETHROWER && !src.warFlamethrower)
				src.verbs += new /turf/construct/verbcache/WarFact/verb/Flamethrower()
				src.warFlamethrower = 1
			if((!src.WarFacts || src.techexp < FLAMETHROWER) && src.warFlamethrower)
				src.verbs -= /turf/construct/verbcache/WarFact/verb/Flamethrower
				src.warFlamethrower = 0
			if(src.WarFacts && src.techexp >= RAILTANK && !src.warRailTank)
				src.verbs += new /turf/construct/verbcache/WarFact/verb/RailTank()
				src.warRailTank = 1
			if((!src.WarFacts || src.techexp < RAILTANK) && src.warRailTank)
				src.verbs -= /turf/construct/verbcache/WarFact/verb/RailTank
				src.warRailTank = 0